package com.free.viewmover;

import android.graphics.Matrix;
import android.view.View;

public class TranslateAniItem implements AniItem
{
	public float transDeltaX = 0;
	public float transDeltaY = 0;
	
	public void applyAni(FlipMover mover)
	{
//		System.out.println(transDeltaX);
//		float[] value = new float[9];
//		canvas.getMatrix().getValues(value);
//		String msg = "base_pos - " + Float.toString(value[Matrix.MTRANS_X]) + ", " +  Float.toString(value[Matrix.MTRANS_Y]);
//		System.out.println(msg);
		
		Matrix matrix = mover.getAniMatrix();
		matrix.preTranslate(transDeltaX, transDeltaY);
		
//		View view = mover.getMasterView();
//		view.layout(view.getLeft()+ (int)transDeltaX
//				, view.getTop() + (int)transDeltaY
//				, view.getRight()+ (int)transDeltaX
//				, view.getBottom() + (int)transDeltaY);
		
//		canvas.getMatrix().getValues(value);
//		msg = "move_pos - " + Float.toString(value[Matrix.MTRANS_X]) + ", " +  Float.toString(value[Matrix.MTRANS_Y]);
//		System.out.println(msg);
	}
	
	public AniItem clone()
	{
		try
		{
			return (AniItem) super.clone();
		}
		catch( CloneNotSupportedException e )
		{
			return null;
		}
	}
}
